﻿using System.Diagnostics.Contracts;

namespace TaskManager.Domain.BusinessObjects
{
    /// <summary>
    /// Task log entry
    /// </summary>
    public class TaskLogEntry : LogEntry
    {
        /// <summary>
        /// Task identifier
        /// </summary>
        public int TaskId { get; private set; }

        /// <summary>
        /// Parameterless constructor
        /// </summary>
        public TaskLogEntry()
        {
            
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="task">Task</param>
        /// <param name="user">User who modified task</param>
        /// <param name="message">Message</param>
        public TaskLogEntry(Task task, User user, string message)
            :base(user, message)
        {
            Contract.Requires(task != null);

            TaskId = task.Id;
            User = user.Name;
            Message = message;
        }
    }
}